package top.rish.converter.core.annotation.handler;

import top.rish.converter.core.base.DictEntity;
import top.rish.converter.core.info.FieldWrap;
import top.rish.converter.core.info.MetaMap;
import top.rish.converter.core.utils.RefKit;

import java.lang.annotation.Annotation;


public interface DictConvertHandler<A extends Annotation> {

     default Class<A> getAnnonationClass(){
          return RefKit.getGenericClass(this.getClass(),0);
     }

     default void doConvert(MetaMap mateMap,
                            DictEntity entity,
                            Object value,
                            FieldWrap fieldWrap, Annotation convert){
          this.convert(mateMap,entity,value,fieldWrap,(A) convert);
     }

     void convert(MetaMap mateMap,
                  DictEntity entity,
                  Object value,
                  FieldWrap fieldWrap, A convert);


}
